#!/bin/bash
Num=$(ps -C haproxy --no-header|wc -l)

if [ $Num -eq 0 ];then
	systemctl start haproxy   #启动haproxy
	#haproxy -f /etc/haproxy/haproxy.cfg
	sleep 2
	if [ $(ps -C haproxy --no-header|wc -l) -eq 0 ];then
		systemctl stop keepalived
	fi
fi

